<p id="title"><?php  echo $this->title; ?>  </p>
<form method="POST" name="boo">
<?php
$ticket = new Ticket();
$action = 'insert';
if (isset ( $this->objectData )) {
	$action = 'update';
}
?>
<input type="hidden" name="actiontype" value="<?php echo $action;?>" />
	<input type="hidden" name="Ticket_id" id="ticket_id"
		value="<?php echo $this->bind('id')?>">
	<div class="elem">
		<label for="ticket_trip"> Trip </label> 
			<select name="Ticket_trip" id="ticket_trip">
				<?php		
					foreach ($this->relativeData as $entity) {
						if ($this->bind('trip') == $entity['tripid'])
							echo '<option selected="selected" value="'.$entity['tripid'].'" >'.$entity['pointstart'].' -> '.$entity['pointend'].'</option>';
						else
							echo '<option value="'.$entity['tripid'].'">'.$entity['pointstart'].' -> '.$entity['pointend'].'</option>';
					}					
				?>
			</select>
	</div>
	<div class="elem">
		<label for="ticket_customer"> Customer</label> <input type="text"
			name="Ticket_customer" id="ticket_customer"
			value="<?php echo $this->bind('customer')?>">
	</div>
	<div class="elem">
		<label for="ticket_seat"> Seat</label>
			<select name="Ticket_seat" id="ticket_seat">
				<?php	
					echo '<option selected="selected" value="'.$this->bind('seat').'" >'.$this->bind('seat').'</option>';
					foreach ($this->seatdata as $entity) {
							echo '<option value="'.$entity['id'].'">'.$entity['position'].'</option>';
					}					
				?>
			</select>
	</div>
	<?php if($action=='insert')
		echo '<input type="hidden" name="Ticket_status" id="ticket_status" value="1">';
	?>
	
	<button type="submit" onclick="document.boo.submit()" style="display: none;">Save</button>
</form>